import { baseUrl } from './config.js';

export function topList(){
	return new Promise(function(resolve,reject){
			uni.request({
					url: `${baseUrl}/`,
					method: 'GET',
					data: {},
					success: res => {
						let result = res.data.list;
						resolve(result.splice(0, 4));
						// console.log("list",+ res)
					},
					fail: (err) => {
						console.log(err);
					},
					complete: () => {}
				
			});
	});
	}
export function list(listId) {
	return uni.request({
				url: `${baseurl}/playlist/detail?id=${listid}`,
				method:'GET'
    });
}
